package br.com.massai.model.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.ejb.Local;

import br.com.massai.model.exception.SystemException;

@Local
@SuppressWarnings({ "rawtypes" })
public interface IGenericDao<T> extends Serializable {

	public static final String PERSISTENCE_UNIT = "Massai-PU";

	public T create(T entity) throws SystemException;
	public T update(T entity) throws SystemException;
	public void delete(T entity) throws SystemException;
	public List<T> findAll() throws SystemException;
	public T findId(Long id) throws SystemException;
	public List<T> findNamedQuery(String namedQuery) throws SystemException;
	public List<T> findParameters(int offset, int length, Map<String, Object> parameters, StringBuilder clauseWhere) throws SystemException;
	public List<T> findExamples(T entity) throws SystemException;
	public String getNamedQuery(String namedQuery, Class c) throws SystemException;
	public void setEntity(Class<T> entity);
	public int count(Map<String, Object> parameters, StringBuilder clauseWhere) throws SystemException;
}